import request from "../utils/request.js";

const toolApi = {
    getList() {
        return request.get('/tool/getAllTools')
    },
    getById(id) {
        return request.get(`/tool/getToolById/${id}`)
    },
    getByCategory(categoryId) {
        return request.get(`/tool/getToolByCategory/${categoryId}`)
    },
    add(data) {
        return request.post('/tool/addTool',data)
    },
    update(data) {
        return request.put('/tool/updateTool',data)
    },
    delete(id) {
        return request.post(`/tool/deleteTool/${id}`)
    },
    getListWithCategoryName() {
        return request.get('/tool/getToolWithCategoryName')
    },
    updateWithCategoryName(data) {
        return request.post('/tool/updateWithCategoryName',data)
    },
    addWithCategoryName(data) {
        return request.post('/tool/addWithCategoryName',data)
    }
}

export default  toolApi